import request from '@/utils/request'

// 获取商品分页列表
export function getProductPage(params) {
  return request({
    url: '/store/product/page',
    method: 'get',
    params
  })
}

// 获取商品详情
export function getProduct(id) {
  return request({
    url: '/store/product/get?id=' + id,
    method: 'get'
  })
}

// 获取商品分类列表
export function getCategoryList(params) {
  return request({
    url: '/store/category/list',
    method: 'get',
    params
  })
}

// 创建商品
export function createProduct(data) {
  return request({
    url: '/store/product/create',
    method: 'post',
    data: data
  })
}

// 更新商品
export function updateProduct(data) {
  return request({
    url: '/store/product/update',
    method: 'put',
    data: data
  })
}

// 删除商品
export function deleteProduct(id) {
  return request({
    url: '/store/product/delete?id=' + id,
    method: 'delete'
  })
} 